When a streaming multimedia rendering/capturing device (such as an audio device) renders or captures data, it can be important for processing purposes, to know which data in the stream the device's hardware is currently rendering or capturing. Information that describes which data is currently being rendered or captured is typically referred to as position information usually dealing with an offset into the stream. Having accurate position information can greatly facilitate operations that are performed on data such as acoustic echo cancellation operation, synchronization operations (such as synchronizing audio data with video data) and the like.
One type of audio rendering/capturing device is a Universal Serial Bus (USB) audio device. In USB audio devices, the clock source used to determine the current position of audio data being processed by the device is the USB Start of Frame (SOF) counter. The USB SOF counter works at a granularity of one millisecond. Specifically, by design the USB bus uses one millisecond frames to process audio data. Thus, the USB SOF counter works in one millisecond increments. Many times, however, this counter is not very reliable which can lead to errors in position information that is derived from SOF counter measurements.
In addition, many applications that require precise position information cannot be employed reliably at the granularity of one millisecond. For example, using the USB SOF counter to derive position information, and relating that information to other data clocks, can cause “jumps” in the position information which makes it difficult, if not impossible, for applications such as acoustic echo cancellation to follow the trending of the information and perform its function. Specifically, in audio systems in which there is a USB Audio device, an audio pump running on its own clock period is used to process audio data through the system. The USB audio device driver derives position information from the SOF counter's one millisecond boundaries and passes that information to the audio engine for use. If the audio pump's clock is slightly off from the SOF counter's clock, it is possible for a boundary to be missed, thus resulting in a jump in the position data that is ultimately derived.